import './assets/main.css'

import { createApp } from 'vue'
import { createPinia } from 'pinia'

import App from './App.vue'
import router from './router'

import Antd from 'ant-design-vue';
import 'ant-design-vue/dist/reset.css';

import * as Icons from '@ant-design/icons-vue';

import Back from '@/components/icons/Back.vue'; // 引入 Back.vue 组件
import Tabbar from '@/components/Tabbar.vue';

// 引入 Vant
import Vant from 'vant';
import 'vant/lib/index.css';

const app = createApp(App)

app.use(createPinia())
app.use(router)
app.use(Antd)

// 全局注册所有图标
for (const [key, component] of Object.entries(Icons)) {
  if (key !== 'default') {
    app.component(key, component)
  }
}

// 全局注册 Back 组件
app.component('Back', Back);
app.component('Tabbar', Tabbar);

// 全局注册 Vant 的所有组件
app.use(Vant);

app.mount('#app')